﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Dragon_Fighter.Cenas
{
    public class Cena_Jogo
    {        
        GameWindow Window;
        Texture2D chao;
        Texture2D neve;
        Vector2 posicaoChao;
        Vector2[] posicoes;
        Vector2 velocidade;        
        Objetos.Personagem personagem;

        public Cena_Jogo(ContentManager Content, GameWindow Window)
        {
            this.Window = Window;            
            posicaoChao = new Vector2(0, 410);
            chao = Content.Load<Texture2D>("chao");
            neve = Content.Load<Texture2D>("neve");
            personagem = new Objetos.Personagem(Content.Load<Texture2D>("personagem"),posicaoChao,velocidade, Window);

            Random rnd = new Random();
            posicoes = new Vector2[100];
            for (int i = 0; i < posicoes.Length; i++)
            {
                int x = rnd.Next(800);
                int y = rnd.Next(430);
                posicoes[i] = new Vector2(x, y);  
            }
            velocidade = new Vector2(1, 1);
        }
             
        public void Update(GameTime gameTime)
        {
            
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {            
            spriteBatch.Draw(chao, posicaoChao, Color.White);
            
            for (int i = 0; i < posicoes.Length; i++)
            {
                spriteBatch.Draw(neve, posicoes[i], Color.White);
            }
            personagem.Draw(gameTime, spriteBatch);
        }
    }
}
